public class Animal {
    protected String name;
    protected int age;
    protected String gender;
    protected int legNum;
    protected double weight;
    //空构造函数
    public Animal(){};

    public Animal(String name, int age, String gender, int legNum, double weight){
        this.name = name;
        this.age = age;
        this.gender = gender;
        this.legNum = legNum;
        this.weight = weight;
    };
    protected void eatting(String food){
        System.out.println(name +"正在吃" + food);
    }

    //重写方法
    @Override
    public String toString()
    {
        return "Animal {" +
                "name" + name + '\'' +
                "age" + age + '\'' +
                "gender" + gender + '\'' +
                "legNum" + legNum + '\'' +
                "weight" + weight + '\'' +
                "}";

    }
}
